import { createRouter, createWebHashHistory } from 'vue-router'
import { routerPath } from './path'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: routerPath,
  scrollBehavior (to, from, savedPosition) {
    if (to.name == "info") {
      return { top: 0 }
    } else {
      return savedPosition != null ? savedPosition : false
    }
  }
})

export default router
